package com.webapi.core.model.persist;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

import com.webapi.core.model.common.AgentStatus;

@Entity
@Table(name = "tb_agent")
public class Agent extends Base implements Serializable {

	private static final long serialVersionUID = -4179031117613959246L;

	@Column(name = "code", length = 10, unique = true, nullable = false)
	private String code;

	@Column(name = "domain", length = 50, nullable = false)
	private String domain;

	@Column(name = "secret", unique = true, length = 32, nullable = false)
	private String secret;

	@Enumerated(EnumType.STRING)
	@Column(name = "status", length = 15, nullable = false)
	private AgentStatus status;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDomain() {
		return domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public AgentStatus getStatus() {
		return status;
	}

	public void setStatus(AgentStatus status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "Agent [code=" + code + ", domain=" + domain + ", secret="
				+ secret + ", status=" + status + "]";
	}

}
